package com.ye.pojo;

import com.alibaba.nacos.api.config.ConfigType;
import com.alibaba.nacos.api.config.annotation.NacosConfigurationProperties;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.validation.constraints.Email;

/**
 * @Description: TODO
 * @author: scott
 * @date: 2022年03月31日 19:27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Configuration
//@ConfigurationProperties(prefix = "teacher")
@NacosConfigurationProperties(prefix = "teacher", dataId = "data-id-teacher", groupId = "DEFAULT_GROUP", autoRefreshed = true, ignoreInvalidFields = true, type = ConfigType.PROPERTIES)
public class Teacher {
    private int id;
    private String name;
    private String password;
    @Email
    @NacosValue(value = "${teacher.email:123456@qq.com}", autoRefreshed = true)
    private String email;
    private String phone;
}
